package com.huixh.train.business.enums;

import java.math.BigDecimal;

/**
 * @author huixh
 */
public enum SeatTypeEnum {
    /**
     * 一等座
     */
    YDZ("1", "一等座", new BigDecimal("0.4")),

    EDZ("2", "二等座", new BigDecimal("0.3")),

    GZ("3", "商务座", new BigDecimal("0.8")),

    RW("4", "软卧", new BigDecimal("0.6")),

    YW("5", "硬卧", new BigDecimal("0.5"));
    private String code;

    private String desc;

    private BigDecimal val;

    public static SeatTypeEnum getByCode(String code) {
        for (SeatTypeEnum seatTypeEnum : SeatTypeEnum.values()) {
            if (seatTypeEnum.getCode().equals(code)) {
                return seatTypeEnum;
            }
        }
        return null;
    }

    SeatTypeEnum() {
    }

    SeatTypeEnum(String code, String desc, BigDecimal val) {
        this.code = code;
        this.desc = desc;
        this.val = val;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public BigDecimal getVal() {
        return val;
    }

    public void setVal(BigDecimal val) {
        this.val = val;
    }

}
